package main

import "fmt"

func printSlice(mySlice []int) {
	//引用传值
	//_ 表示匿名的变量
	for _, val := range mySlice {
		fmt.Println("val=", val)
	}

	mySlice[0] = 100
}

func main() {
	//动态数组 切片
	myArray := []int{1, 2, 3, 4, 5, 6}

	fmt.Printf("myArray type is %T\n", myArray)
	printSlice(myArray)

	fmt.Println(" ===== ")
	for _, val := range myArray {
		fmt.Println("val=", val)
	}
}
